package com.kai.config;


import com.kai.interceptor.ExpressPickUpServerInterceptor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

@Component
@Slf4j
public class WebMvcConfiguration extends WebMvcConfigurationSupport {

    @Autowired
    private ExpressPickUpServerInterceptor expressPickUpServerInterceptor;

    protected void addInterceptors(InterceptorRegistry registry) {
        log.info("开始注册自定义拦截器...");
        registry.addInterceptor(expressPickUpServerInterceptor)
                .addPathPatterns("/express/**")
                .excludePathPatterns("/express/user/login")
                .excludePathPatterns("/express/user/register");
    }

}
